from spiders.crawer_shipment import get_shipment_info
import time

from project_setting import image_data_path
from crawer_detail import  save_pic,post_code
from predict import predict

from utils.http_utils import make_shipment_coookie

from spiders.crawer_shipment import get_shipment_info
from pprint import pprint
from spiders import parse_shipment

from crawer_website import save_data

if __name__ == '__main__':
    id = '146900296776'
    res = parse_shipment('146100515376')
    #res = parse_esvcCom("146101109754")
    #pprint(res)
    #res = {'B/L No': 'EGLV 146900296776', 'Vessel Voyage on B/L': 'CMA CGM T. JEFFERSON 0TX2XE1MA', 'Basic Information': {'Place of Receipt': 'XIAMEN, CHINA (CN)', 'Container Count': '1', 'Port of Loading': 'XIAMEN, CHINA (CN)', 'Gross Weight': '8,367.200 KGS', 'Port of Discharge': 'LOS ANGELES, CA (US)', 'Measurement': '63.5120 CBM', 'Place of Delivery': 'LOS ANGELES, CA (US)', 'Manifest Quantity': '664 CARTONS', 'Estimated On Board Date': 'MAY-06-2019', 'Service Mode': 'PORT/PORT'}, 'Containers': [{'Container No': 'TCNU6617530', 'Size/Type': "40'(SH)", 'Seal No': 'EMCRXU3688', 'Service Type': 'FCL/FCL', 'Quantity': '664 CARTONS', 'Method': '', 'VGM': '', 'Current Status': '', 'Date': ''}], 'Advance Filing Status': {'Customs': 'US', 'Description': 'XIAMEN, CHINA (CN)', 'Filing POL': 'LOS ANGELES, CA (US)', 'Filing POD': 'CMA CGM T. JEFFERSON 0TX2X', 'Filing VSL/VOY': 'MAY-06-2019'}, 'ReleaseStatus': {'Carrier Status': {'Status': 'Released', 'Freight': 'Received', 'Date': 'JUN-17-2019', 'Remark': '', 'Bill of Lading': 'Sea Waybill'}, 'Customs Status': {'IT NO': '', 'Port': '', 'IT Destination': '', 'Date1': '', 'Status': 'RELEASED', 'Description': 'RELEASED BY US.CUSTOMS AT LOS ANGELES, CA', 'Date': 'MAY-13-2019'}}, 'Contact Office': {'Destination Office': {'Contact Office': 'LOS ANGELES, CA', 'Phone Number': '1-714-8226800'}}, 'Pick-up Reference Information': {'Name': 'FENIX MARINE SERVICE - BERTH 300 (SPQ)', 'Address1': '614 TERMINAL WAY,\nBEFORE RETURNING EXPORT LOAD, PLEASE CALL 310-548-8815 TO CONFIRM IF VESSEL IS OPEN FOR RECEIVING FULL EXPORT CONTAINER.', 'Address2': '', 'City': 'TERMINAL ISLAND', 'State': 'CA', 'Zip Code': '90731', 'Business Hours': '', 'Contact Person': 'Glenn Farren', 'Phone Number': '1-310-5488815-', 'Fax Number': '1-310-5488836'}}
    save_data(url='crawlEsvc', craw_id=id, res=res),
